package com.lyj.mode.decorator;

/**
 * 装饰者
 * @author:liyajie
 * @createTime:2022/2/25 14:40
 * @version:1.0
 */
public class Decorator extends Coffee{

    private Coffee coffee;

    public Decorator(Coffee coffee){
        this.coffee = coffee;
    }

    @Override
    public float cost() {
        return super.getPrice() + this.coffee.cost();
    }

    @Override
    public String getDesc() {
        return super.getDesc() + coffee.cost();
    }
}
